<template>
  <div>
    {{ name }}
    {{ score }}
    <van-button type="primary" @click="handleScore">修改成绩</van-button>
  </div>
</template>

<script setup lang="ts">
interface User {
  name: string;
  score: number;
}
defineProps<User>();

// emits
// const emits = defineEmits(["change-score"]);
interface EmitType {
  (e: "change-score", n: number): void;
  (e: "change-name", name: string): void;
}
const emits = defineEmits<EmitType>();

const handleScore = () => {
  emits("change-score", 20);
};
</script>

<style scoped></style>
